<!DOCTYPE html>
<html lang="zh-cn">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title>CC1101和MSP430调试 - macdfree&#39;s blog</title>
  <meta name="renderer" content="webkit" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>

<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<meta name="theme-color" content="#f8f5ec" />
<meta name="msapplication-navbutton-color" content="#f8f5ec">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="#f8f5ec">


<meta name="author" content="macd" />
  <meta name="description" content="本篇记录最近调试基于MSP430的CC1101射频通信程序中遇到的问题和需要注意的地方。
" />

  <meta name="keywords" content="blog, macd, even" />


<meta name="baidu-site-verification" content="Ak74Sk61bk" />
<meta name="google-site-verification" content="fAeFHpkrhfFS8LxdzXy0EtAPcVStv0faGn238sRF3L8" />


<meta name="generator" content="Hugo 0.54.0" />


<link rel="canonical" href="/posts/cc1101%E5%92%8Cmsp430%E8%B0%83%E8%AF%95/" />

<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">




<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>


<link href="/dist/even.min.css?v=3.1.1" rel="stylesheet">
<link href="/lib/fancybox/jquery.fancybox-3.1.20.min.css" rel="stylesheet">




<meta property="og:title" content="CC1101和MSP430调试" />
<meta property="og:description" content="本篇记录最近调试基于MSP430的CC1101射频通信程序中遇到的问题和需要注意的地方。" />
<meta property="og:type" content="article" />
<meta property="og:url" content="/posts/cc1101%E5%92%8Cmsp430%E8%B0%83%E8%AF%95/" />
<meta property="article:published_time" content="2014-06-04T00:00:00&#43;00:00"/>
<meta property="article:modified_time" content="2014-06-04T00:00:00&#43;00:00"/>

<meta itemprop="name" content="CC1101和MSP430调试">
<meta itemprop="description" content="本篇记录最近调试基于MSP430的CC1101射频通信程序中遇到的问题和需要注意的地方。">


<meta itemprop="datePublished" content="2014-06-04T00:00:00&#43;00:00" />
<meta itemprop="dateModified" content="2014-06-04T00:00:00&#43;00:00" />
<meta itemprop="wordCount" content="667">



<meta itemprop="keywords" content="CC1101,MSP430," />
<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="CC1101和MSP430调试"/>
<meta name="twitter:description" content="本篇记录最近调试基于MSP430的CC1101射频通信程序中遇到的问题和需要注意的地方。"/>

<!--[if lte IE 9]>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/classlist/1.1.20170427/classList.min.js"></script>
<![endif]-->

<!--[if lt IE 9]>
  <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
<![endif]-->

</head>
<body>
  <div id="mobile-navbar" class="mobile-navbar">
  <div class="mobile-header-logo">
    <a href="/" class="logo">macdfree&#39;s blog</a>
  </div>
  <div class="mobile-navbar-icon">
    <span></span>
    <span></span>
    <span></span>
  </div>
</div>
<nav id="mobile-menu" class="mobile-menu slideout-menu">
  <ul class="mobile-menu-list">
    <a href="/">
        <li class="mobile-menu-item">首页</li>
      </a><a href="/categories/">
        <li class="mobile-menu-item">分类</li>
      </a><a href="/tags/">
        <li class="mobile-menu-item">标签</li>
      </a><a href="/archive/">
        <li class="mobile-menu-item">归档</li>
      </a>
  </ul>
</nav>
  <div class="container" id="mobile-panel">
    <header id="header" class="header">
        <div class="logo-wrapper">
  <a href="/" class="logo">macdfree&#39;s blog</a>
</div>

<nav class="site-navbar">
  <ul id="menu" class="menu">
    <li class="menu-item">
        <a class="menu-item-link" href="/">首页</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/categories/">分类</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/tags/">标签</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/archive/">归档</a>
      </li>
  </ul>
</nav>
    </header>

    <main id="main" class="main">
      <div class="content-wrapper">
        <div id="content" class="content">
          <article class="post">
    
    <header class="post-header">
      <h1 class="post-title">CC1101和MSP430调试</h1>

      <div class="post-meta">
        <span class="post-time"> 2014-06-04 </span>
        <div class="post-category">
          
            <a href="/categories/note/"> note </a>
          
        </div>
        <span class="more-meta"> 约 667 字 </span>
        <span class="more-meta"> 预计阅读 2 分钟 </span>
        <span id="busuanzi_container_page_pv" class="more-meta"> <span id="busuanzi_value_page_pv"><img src="/img/spinner.svg" alt="spinner.svg"/></span> 次阅读 </span>
      </div>
    </header>

    
    
<div class="post-toc" id="post-toc">
  <h2 class="post-toc-title">文章目录</h2>
  
  <div class="post-toc-content always-active">
    
  </div>
</div>

    
    <div class="post-content">
      <p>本篇记录最近调试基于MSP430的CC1101射频通信程序中遇到的问题和需要注意的地方。</p>

<ol>
<li><p>MSP430的硬件SPI部分</p>

<p>CC1101与MSP430间的通信通过SPI接口，程序使用MSP430的硬件SPI接口，需要配置相应的寄存器。其中我犯的错误是在配置完寄存器后没有置位USPIEx，关于SPI接口的状态转换图如下：</p>

<p><img src="/images/m7.png" alt="SPI状态转换" /></p>

<p>另外，关于MSP430对IO口复用设置的问题，对于SPI需要设置P3.1、P3.2、P3.3为SPI功能，分别对应SIMO0、SOMI0、UCLK0，其中SOMI0从数据的流向上来说是输入，而SIMO0和UCLK0为输出。那设置时要规定引脚的方向吗？数据手册中的这段话给出了答案：</p>

<blockquote>
<p>Setting PxSELx = 1 does not automatically set the pin direction. Other peripheral module functions may require the PxDIRx bits to be configured according to the direction needed for the module function. See the pin schematics in the device-specific datasheet.</p>
</blockquote>

<p>最后是关于使用非中断方式SPI接口中判断是否发送完毕的检测，照理来说使用IFG1中的UTXIFG0和U0TCTL中的TXEPT都是可以的，但最后还是使用了第二种方法（估计UTXIFG0需要手动清零，未验证）。</p></li>

<li><p>CC1101常用寄存器</p>

<ul>
<li>PKTCTRL1</li>
</ul>

<p>主要设置是否将RSSI和LQI状态字节附加在数据包后，以及是否开启地址检查。</p>

<ul>
<li>PKTCTRL0</li>
</ul>

<p>是否开启CRC校验，设置数据包长度配置，当为可变长时同步词汇后的第一个位配置数据包长度。</p>

<ul>
<li>MCSM1</li>
</ul>

<p>配置数据包发送或被接收后CC1101进入什么状态。</p></li>
</ol>

<hr />

<p>2014-06-08</p>

<p>补充：发现调试到最后加点延时就成功了，然后再把添加的延时注释掉程序依然正常运行，这该如何是好？</p>

<p>插入延时的位置：</p>

<ol>
<li>设置完寄存器后</li>
<li>写TXFIFO后</li>
<li><code>while(!GDO0);while(GDO0);</code>后</li>
<li>每次发送或接收完后</li>
</ol>
    </div>

    
    <div class="post-copyright">
  <p class="copyright-item">
    <span class="item-title">文章作者</span>
    <span class="item-content">macd</span>
  </p>
  <p class="copyright-item">
    <span class="item-title">上次更新</span>
    <span class="item-content">2014-06-04</span>
  </p>
  
  
</div>

    
    
<div class="post-reward">
  <input type="checkbox" name="reward" id="reward" hidden />
  <label class="reward-button" for="reward">赞赏支持</label>
  <div class="qr-code">
    
    
      <label class="qr-code-image" for="reward">
        <img class="image" src="/img/reward/wechat-qr-code.png">
        <span>微信打赏</span>
      </label>
    
      <label class="qr-code-image" for="reward">
        <img class="image" src="/img/reward/alipay-qr-code.png">
        <span>支付宝打赏</span>
      </label>
  </div>
</div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
          <a href="/tags/cc1101/">CC1101</a>
          
          <a href="/tags/msp430/">MSP430</a>
          
        </div>

      
      <nav class="post-nav">
        
          <a class="prev" href="/posts/%E4%BD%8E%E5%8A%9F%E8%80%97%E8%8A%82%E7%82%B9%E8%AE%BE%E8%AE%A1%E6%97%A5%E8%AE%B001/">
            <i class="iconfont icon-left"></i>
            <span class="prev-text nav-default">低功耗节点设计日记01</span>
            <span class="prev-text nav-mobile">上一篇</span>
          </a>
        
          <a class="next" href="/posts/c%E8%AF%AD%E8%A8%80%E5%A4%8D%E6%9D%82%E5%A3%B0%E6%98%8E%E7%9A%84%E7%90%86%E8%A7%A3/">
            <span class="next-text nav-default">C语言复杂声明的理解</span>
            <span class="prev-text nav-mobile">下一篇</span>
            <i class="iconfont icon-right"></i>
          </a>
      </nav>
    </footer>
  </article>
        </div>
        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="social-links">
      <a href="mailto:macdfree@163.com" class="iconfont icon-email" title="email"></a>
      <a href="https://github.com/MACDfree" class="iconfont icon-github" title="github"></a>
  <a href="/index.xml" type="application/rss+xml" class="iconfont icon-rss" title="rss"></a>
</div>

<div class="copyright">
  <span class="power-by">
    由 <a class="hexo-link" href="https://gohugo.io">Hugo</a> 强力驱动
  </span>
  <span class="division">|</span>
  <span class="theme-info">
    主题 - 
    <a class="theme-link" href="https://github.com/olOwOlo/hugo-theme-even">Even</a>
  </span>

  <div class="busuanzi-footer">
    <span id="busuanzi_container_site_pv"> 本站总访问量 <span id="busuanzi_value_site_pv"><img src="/img/spinner.svg" alt="spinner.svg"/></span> 次 </span>
    <span class="division">|</span>
    <span id="busuanzi_container_site_uv"> 本站总访客数 <span id="busuanzi_value_site_uv"><img src="/img/spinner.svg" alt="spinner.svg"/></span> 人 </span>
  </div>

  <span class="copyright-year">
    &copy; 
    
      2014 - 
    2019
    <span class="heart">
      <i class="iconfont icon-heart"></i>
    </span>
    <span class="author">macd</span>
    <span class="division">|</span>
    <span style="margin-left: 5px;">
      <img alt="buildstatus" src="https://travis-ci.org/MACDfree/hugoblog.svg?branch=master">
    </span>
  </span>
</div>
    </footer>

    <div class="back-to-top" id="back-to-top">
      <i class="iconfont icon-up"></i>
    </div>
  </div>
  
<script src="/lib/highlight/highlight.pack.js?v=20171001"></script><script type="text/javascript" src="/lib/jquery/jquery-3.2.1.min.js"></script>
  <script type="text/javascript" src="/lib/slideout/slideout-1.0.1.min.js"></script>
  <script type="text/javascript" src="/lib/fancybox/jquery.fancybox-3.1.20.min.js"></script>
<script type="text/javascript" src="/dist/even.min.js?v=3.1.1"></script>








</body>
</html>
